from django.db import models

# Create your models here.
#用户表(用户名,密码,手机号,邮箱,性别,年龄,用户级别)
class UserInfo(models.Model):
    UserName = models.CharField(max_length=50)
    UserPassword = models.CharField(max_length=50)
    UserPhone = models.IntegerField()
    UserEmail = models.EmailField()
    UserSex = models.CharField(max_length=5)
    UserAge = models.IntegerField()
    UserLevel = models.CharField(max_length=10)

#新闻表(新闻题目,新闻摘要,新闻内容,新闻作者,用户ID,提交时间,类型ID)
class NewsInfo(models.Model):
    NewsTitle = models.CharField(max_length=200)
    NewsDigest = models.CharField(max_length=500)
    NewsContent = models.TextField(max_length=50)
    NewsAuthor = models.CharField(max_length=50)
    NewsUserID = models.IntegerField()
    NewsUpdateTime = models.CharField(max_length=20)
    NewsTypeID = models.IntegerField()

#类型表(类型ID,类型名称)
class TypeInfo(models.Model):
    TypeName = models.CharField(max_length=50)